package com.insigma.business.qrcode.job.dto;


import com.insigma.business.qrcode.common.vo.DescEnum;
import java.util.LinkedHashMap;
import java.util.Map;


public enum QrTypeEnum implements DescEnum {

    
    MERCHANT("sj-"),

    
    ACTIVITY("act-"),

    
    ACTIVITY_ENTRY("act-e"),

    
    ACTIVITY_SIGN_OUT("act-o"),

    
    FAIR("fair-"),

    
    FAIR_ENTER("fair-e");


    QrTypeEnum(String desc) {
        this.desc = desc;
    }

    
    private String desc;


    @Override
    public String getDesc() {
        return desc;
    }


    
    public static QrTypeEnum getByEnumName(final String enumName) {
        for (QrTypeEnum element : values()) {
            if (element.name().equals(enumName)) {
                return element;
            }
        }
        return null;
    }

    
    public static Map<String, String> getName2DescMap() {

        Map<String, String> name2TitleMap = new LinkedHashMap<>();

        for (QrTypeEnum element : values()) {
            name2TitleMap.put(element.name(), element.desc);
        }

        return name2TitleMap;
    }
}
